package raf;

import java.io.IOException;
import java.io.RandomAccessFile;

public class CopyDemo {
    public static void main(String[] args) throws IOException {
        RandomAccessFile src=new RandomAccessFile("./boss.jpg","r");
        RandomAccessFile desc=new RandomAccessFile("./bosscopy.jpg","rw");

        int d;
        while ((d=src.read())!=-1){
            desc.write(d);
        }
        System.out.println("复制完毕!");
        src.close();
        desc.close();
    }
}
